#pragma warning(disable : 4996)

#include<iostream>
#include<stdarg.h>
#include<stdio.h>
#include<string>
#include<time.h>
#include<vector>

#ifdef _WIN32
  
#include <windows.h>

#elif __linux__

#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>

#endif

enum grade
{
    Info,      //���� 0
    Warning,   //���� 1
    Error,     //���� 2
    Fatal,     //���� 3
    Debug      //���� 4
};

class lwLog
{
public:
    lwLog(size_t flag = 0);

    static std::string getGrade(size_t g);

    int Grade(std::string& g);

    void operator()(size_t grade, int line, const char* s, ...);
        
public:
    //0 Ĭ��  1 ֻ��ӡ  2 ��ӡ���洢��һ���ļ�  Ĭ�� ��ӡ��������ļ� 3 ����ӡ��ֻдͬһ���ļ� 4 ����ӡ������д
    size_t _flag;
    //��ʱ�洢��־
    std::vector<std::string> _log;
};